package pojo;

import org.springframework.format.annotation.DateTimeFormat;

import java.util.Arrays;
import java.util.Date;


/**
 * @author SWJ
 * @create 2021-07-15 15:30
 */

//modle层注意数据类型
public class student {
private String user;
private Integer age;
private Integer sex;
private String[] like;
/**保存了页面提供的多个爱好*/
 private Integer edu;

/**页面提交的日期都是String 类型
 * 需要自己变成string类型 */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
 private Date intime;
 /**使用Date方法要导包是当前时间*/

    public String getUser() {
        return user;
    }

    public void setUser(String user) {
        this.user = user;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public Integer getSex() {
        return sex;
    }

    public void setSex(Integer sex) {
        this.sex = sex;
    }

    public String[] getLike() {
        return like;
    }

    public void setLike(String[] like) {
        this.like = like;
    }

    public Integer getEdu() {
        return edu;
    }

    public void setEdu(Integer edu) {
        this.edu = edu;
    }

    //页面提交的日期都是String类型，需要自己变成Date类型，否则页面永远400错误
    @DateTimeFormat(pattern="yyyy-MM-dd" )
    public Date getIntime() {
        return intime;
    }

    public void setIntime(Date intime) {
        this.intime = intime;
    }


    @Override
    public String toString() {
        return "Student{" +
                "user='" + user + '\'' +
                ", age=" + age +
                ", sex=" + sex +
                ", hobby=" + Arrays.toString(like) +
                ", edu=" + edu +
                ", intime=" + intime  +
                '}';
    }
}
